<?php
namespace Common\Model;


use Common\Common\Model;

class jobhunterModel extends Model{

    protected $tableName = 'jobhunter';

    protected $tablePrimary = "id";

    protected $odjectClass='Common\Model\jobhunterObject';

    public function fetchByUsername($key){
        $result = $this->where(['username'=>$key])->find();
        if($result == null) return null;
        return $this->make($result);
    }

    /**
     * 用户登录标记
     * @param CustomerObject $user
     */
    public function login(CustomerObject $user){
        $_SESSION['id'] = $user->ID;
    }

    public function test(){
        $user2=$_SESSION['id'];
        return  $user2;
    }

}